//
//  VIPSignalingProtocol.h
//  TTProduct
//
//  Created by My mac on 2019/7/31.
//  Copyright © 2019年 TTProduct. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AgoraSigKit/AgoraSigKit.h>

#import "VIPSignalModel.h"
#import "VIPMessage.h"

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSInteger,VIPSignalCode) {
    VIPSignalCodeSuccess                       = 0,     // 没有错误
    VIPSignalCodeLogout                        = 101,   // 退出
    VIPSignalCodeKiched                        = 103,   // 该账户已在别处登录
    VIPSignalCodeTokenLose                     = 105,   // SignalingToken 过期
    VIPSignalCodeLoginError                    = 200,   // 登录失败
    VIPSignalCodeSendError                     = 400,   // 发送消息失败未知错误
    VIPSignalCodeTimeout                       = 408,   // 超时
    VIPSignalCodeOther                         = 999    // 其他问题
};

typedef void(^VIPCompletionHandler)(VIPMessage * _Nullable message);

@protocol VIPSignalingProtocol <NSObject>

@optional
- (void)registerSignalingSDK:(nullable VIPSignalModel *)signal; // 注册信令
- (void)loginCompletion:(nullable VIPCompletionHandler)completion; // 登陆信令
- (void)loginedLostConnectionCompletion:(nullable VIPCompletionHandler)completion; // 中途连接
- (void)joinRoomCompletion:(nullable VIPCompletionHandler)completion; // 进入房间
- (void)sendMessageCompletion:(nullable VIPCompletionHandler)completion; // 发送
- (void)leaveRoomCompletion:(nullable VIPCompletionHandler)completion; // 退出房间
- (void)logoutCompletion:(nullable VIPCompletionHandler)completion; // 退出信令

@end

NS_ASSUME_NONNULL_END
